<?php
require_once("Includes.php");

class Faculty extends Database_object 
    {
     protected static $table_name="faculty";
	   protected static $db_fields = array('ID','description', 'name' , 'position' , 'date');
     protected $ID;
     protected $description;
	   protected $name;
	   protected $position;
	   protected $date;
	 
   public function get_id()
   {
     return $this->ID;
   }

  public function set_name($name)
  {
    $this->name = $name;
  }

  public function get_name()
  {
    return $this->name;
  }
	 
  public function set_description($description)
  {
    $this->description = $description;
  }

  public function get_description()
  {
    return $this->description;
  }
	 
  public function set_position($position)
  {
    $this->position = $position;
  }

  public function get_position()
  {
    return $this->position;
  }

  public function set_date($date)
  {
    $this->date = $date;
  }

  public function get_date()
  {
    return $this->date;
  }

  public static function get_all_faculties()
  {
    global $database;
    $sql="SELECT name FROM ". self::$table_name ."";
    $result = $database->doQuery($sql);
    if (mysqli_num_rows($result) == 0)
    {
      return false;
    }
    return $result;
  }
}
?>